home *** CD-ROM | disk | FTP | other *** search
/ PCMania 34 / PCMania CD34.iso / sharewar / util / clip / clipstac.doc < prev    next >
Encoding:
Text File  |  1992-07-15  |  12.9 KB  |  232 lines

  1. CLIPSTAC (Version 1.0)                    Copyright (c) 1992 PC Magazine
  2. ------------------------------------------------------------------------
  3. Richard Hale Shaw                                 August 1992 (Utilities
  4. ------------------------------------------------------------------------
  5.  
  6. CLIPSTAC:
  7.  
  8.      The Windows Clipboard over writes its entire contents the moment you
  9. copy a fresh piece of text or cut a second image to it. The Clipboard can
  10. hold one and only one item at a time; it is absolutely unforgiving.
  11. And, as you may have found, it takes just one accidentally lost cut to
  12. make you wish the Clipboard could accommodate multiple items.
  13.  
  14.       CLIPSTAC eliminates this dangerous limitation. CLIPSTAC creates a
  15. stack, or history list, of all the texts and bitmaps that any program cuts
  16. or copies to or from the Clipboard. It saves all these items in a file,
  17. CLIPSTAC.DAT, from which you can copy items back to the Clipboard by
  18. selecting the desired entry from a list box.
  19.  
  20.      Thus, anything you put onto the Clipboard can be retrieved and
  21. reused, day after day, from one Windows session to another. This not only
  22. safeguards your work, but makes the Clipboard a natural place to store
  23. and access frequently used logos, boilerplate texts, and the like.
  24. CLIPSTAC works equally well with both Windows 3.0 and 3.1.
  25.  
  26.       If you wish to recompile the utility you'll need a ~C++ compiler
  27. for Windows that supports templates. (I used Borland C++ 3.0; you can
  28. also use Microsoft C 7.0 or Zortech C++ 3.0.)
  29.  
  30. USING CLIPSTAC
  31.  
  32.      CLIPSTAC requires no special syntax or parameters. You can add it
  33. to a Program Group by choosing File, New from the Program Manager.
  34. Or you can choose File, Run and execute it from the command line simply
  35. by entering the following line:
  36.  
  37.                                 CLIPSTAC
  38.  
  39.      Probably the best way to take advantage of CLIPSTAC, however, is
  40. to set it up so that it loads whenever you run Windows. To do this, just
  41. check the AutoLoad item in the CLIPSTAC System Menu. This will put the
  42. full path of CLIPSTAC.EXE in the LOAD= entry of WIN.INI; each time
  43. you start Windows thereafter, CLIPSTAC will run as a minimized program.
  44. Alternatively, if you're using Windows 3.1, you can just add CLIPSTAC
  45. to your Startup group.
  46.  
  47.      To terminate CLIPSTAC, just select Close from its System Menu or
  48. double-click on the CLIPSTAC System icon.
  49.  
  50.      Once it's loaded, CLIPSTAC will open (or create) the CLIPSTAC.DAT
  51. file in your Windows directory.  If the Clipboard already has something
  52. on it, CLIPSTAC will automatically retrieve a copy. (You can always
  53. retrieve additional copies of items in the Clipboard using CLIPSTAC's
  54. Paste button.)  When you use CLIPSTAC to copy text or a bitmap to the
  55. Clipboard, CLIPSTAC will automatically make a copy and store it in
  56. CLIPSTAC.DAT.
  57.  
  58.      The CLIPSTAC interface consists of a single dialog box with a list
  59. box and several buttons. Whenever you copy a new item to the Clipboard,
  60. a new entry is added to the beginning of CLIPSTAC's list, which is
  61. displayed in the list box. Each entry displays the date and time that
  62. the item was retrieved from the Clipboard, the format (text, bitmap,
  63. and so on), the size of the item, and, when available, the name of the
  64. program that put the item onto the Clipboard. For text items, CLIPSTAC
  65. also displays the first 21 characters of text in its Contents field.
  66.  
  67.      A program can have more than one Clipboard format, or version of
  68. an item, in the Clipboard at a time.  Because CLIPSTAC always retrieves
  69. as many different item formats as are available, the same item will
  70. often appear (under different formats) more than once in CLIPSTAC's 
  71. list.  This is particularly true with text items, for which two character
  72. sets are available.
  73.  
  74.      Typically, the program that puts an item onto the Clipboard is the
  75. Clipboard owner. But some programs (Notepad is one) do not access the
  76. Clipboard themselves; they use Windows' USER.DLL to accesss the Clipboard
  77. for them. In such a case the Clipboard owner will be the "User."
  78.  
  79.      You can select an item in CLIPSTAC's list by single-clicking on
  80. it with the mouse. (To select from the keyboard, Tab to the list and
  81. use the Arrow keys within the list.)  Pressing the Copy button when an
  82. item is selected (highlighted) will copy that item from CLIPSTAC's list
  83. back onto the Clipboard.  (Double-clicking on an item will accomplish
  84. the same thing.)  Note that when you copy an item from CLIPSTAC to the
  85. Clipboard, CLIPSTAC will sense the change in the Clipboard and recopy
  86. the item to the top of its list--just as it would if any other program
  87. had changed the Clipboard's contents.
  88.  
  89.      The Delete button removes a selected item from the list. The Paste
  90. button adds the item currently in the Clipboard to the top of CLIPSTAC's
  91. list. This is the same action that CLIPSTAC takes automatically when you
  92. change the Clipboard's contents. Paste, however, provides a convenient
  93. way to retrieve more than one copy of an item into CLIPSTAC's list
  94. without having to recopy it back onto the Clipboard from the program
  95. that put it there.
  96.  
  97. A QUICK TUTORIAL
  98.  
  99.      As all experienced Windows users probably know, you don't need to
  100. display the contents of Clipboard in order to make use of it. The
  101. Clipboard functions are available to applications whenever Windows is
  102. running. What you activate when you double-click on the Clipboard icon
  103. (or run CLIPBRD.EXE) is only the Clipboard Viewer. I suggest that you
  104. keep the Windows Clipboard Viewer open during your first experiments
  105. with CLIPSTAC so that you can monitor the Clipboard's contents at each
  106. step. You will also want to have CLIPSTAC open, of course, as well as
  107. a simple text editor (Notepad will do). It may take a little juggling
  108. to get them all on-screen at once, but the effort will be well spent.
  109.  
  110.      Start by opening a file or typing some text into the Notepad
  111. window and using the mouse to select it. (You can also select text in
  112. the window by holding down the Shift key while you move the cursor to
  113. the end of the desired text.) Then use Edit, Copy or, from the keyboard,
  114. Ctrl-C (Ctrl-Ins in Windows 3.0) to copy the highlighted text to the
  115. Clipboard. Alternatively, you can use Edit, Cut or Ctrl-X (Shift-Del
  116. in Windows 3.0) to cut the text from the editor to the Clipboard.
  117. As soon as you cut or copy text to the Clipboard, an entry representing
  118. that text will appear in CLIPSTAC's list box, as described previously.
  119. Now delete the text in the Clipboard and from the application so you
  120. know that it is only available from CLIPSTAC.
  121.  
  122.      To retrieve the text from CLIPSTAC back into your application,
  123. double-click on the text's entry in CLIPSTAC's list box. (Alternatively,
  124. you can single-click on the entry and press CLIPSTAC's Copy button.)
  125. This will put the item from CLIPSTAC back onto the Clipboard. Then return
  126. to the target application, position the cursor where you want the text
  127. to be inserted, and select Edit, Paste or Ctrl-V (Shift-Ins in
  128. Windows 3.0). Voila! The text will reappear in the target application's
  129. window.
  130.  
  131.      To copy a bitmap from an application into CLIPSTAC, you use a
  132. procedure similar to the one you use for text. For example, to copy a
  133. bitmap from Paintbrush into CLIPSTAC, open Paintbrush and select File,
  134. Open to open a bitmap file (such as 256COLOR.BMP). Select the icon in
  135. the upper-right corner (the one with the scissors and a square) and
  136. select a portion of the bitmap. (Click and hold the mouse button at one
  137. corner of the bitmap and drag the mouse to the other end of the bitmap,
  138. then release the mouse button.)
  139.  
  140.      Then use Edit, Copy (Ctrl-C or Ctrl-Ins) to copy the bitmap onto
  141. the Clipboard and so into CLIPSTAC. CLIPSTAC will display a new entry
  142. for the bitmap, though the Contents field will contain only dots. Clear
  143. the Clipboard once again to assure yourself that you're really making a
  144. copy from CLIPSTAC to the Clipboard in the next step.
  145.  
  146.      Now, to copy the bitmap from CLIPSTAC onto the Clipboard,
  147. double-click on the bitmap entry in CLIPSTAC's list (or single-click
  148. it and press the CLIPSTAC Copy button). Then paste the bitmap from the
  149. Clipboard back into Paintbrush by activating Paintbrush, positioning the
  150. cursor where you want the bitmap to go, and using Edit, Paste (Ctrl-V
  151. or Shift-Ins).
  152.  
  153.  MORE ON CLIPSTAC
  154.  
  155.      You'll notice when using CLIPSTAC that if you have more than ten
  156. entries in its list, you will not see new entries being added. The top
  157. of CLIPSTAC's list has simply scrolled off-screen. When this happens,
  158. a scroll bar will appear; you can use this to scroll through the list
  159. to the top of the stack. Whenever the top of the list is visible you'll
  160. see new items as they are added.
  161.  
  162.       CLIPSTAC limits the number of items you can store in its list.
  163. The default is 500, but you can set a lower limit by making an entry in
  164. WIN.INI, as described below. This may be wise, especially if you use it
  165. for bitmaps; CLIPSTAC.DAT can easily grow beyond several megabytes if
  166. you use it to store many different bitmaps.
  167.  
  168.      Items that you don't use again will eventually fall off the end of
  169. the list. That is to say, when you add the 501st item, the item at the
  170. bottom of the list will be discarded automatically. But whenever you use
  171. an item--that is, copy it from CLIPSTAC's list back onto the Clipboard--
  172. that item will also be copied to the beginning of the list. This safeguard
  173. will generally be enough to prevent a frequently used item from falling
  174. off the end of the list.
  175.  
  176.      Just to be sure, however, CLIPSTAC provides a ToTop button. When you
  177. press this button, the selected CLIPSTAC item is copied to the top of its
  178. list without being copied to the Clipboard, where it would overwrite the
  179. current Clipboard contents. (Of course, this will push every item in the
  180. list down one notch.)
  181.  
  182.      An additional CLIPSTAC feature helps deal with the disk-space
  183. problem that arises if you frequently use bitmaps. To appreciate the
  184. problem, press the Print Screen key while CLIPSTAC is running to copy a
  185. bitmap of the entire Windows desktop onto the Clipboard. (Depending on
  186. your computer, you may have to hit Print Screen twice, Shift-Print
  187. Screen, or Alt-Print Screen, as the Windows manual suggests.) CLIPSTAC's
  188. cursor will change to an hourglass while it copies the bitmap from the
  189. Clipboard into CLIPSTAC.DAT. When the bitmap entry appears in CLIPSTAC's
  190. list, you'll find that CLIPSTAC.DAT may be anywhere from 150K to a full
  191. megabyte, depending on your system's video resolution. All it takes is
  192. three or four of these and CLIPSTAC.DAT will balloon to several megabytes
  193. of valuable disk space.
  194.  
  195.      To prevent this, wherever possible CLIPSTAC duplicates the
  196. information about a list item without duplicating the item itself. Thus,
  197. you don't have to worry about CLIPSTAC.DAT's size exploding if you
  198. frequently use Copy or ToTop. You can prove this to yourself by hitting
  199. the Copy button several times when the desktop bitmap you just made is
  200. highlighted. Now use the File Manager (or DIR in a DOS window) to check
  201. the size of CLIPSTAC.DAT. It will have increased only by the size of the
  202. original bitmap, not by the size of the additional copies.
  203.  
  204.       You can control the number of items in CLIPSTAC's list in two ways.
  205. First, of course, you can use the Delete button to remove selected items
  206. from the list. As mentioned earlier, however, you can also reduce the
  207. default maximum number of items in the list by adding the MaxItems entry
  208. to the [ClipStac] section of WIN.INI. (CLIPSTAC will automatically create
  209. this section the first time you run it.)
  210.  
  211. Thus, you might enter
  212.  
  213.                        MaxItems=100
  214.  
  215. to limit the number of entries in CLIPSTAC's list to 100. Whenever the
  216. number of CLIPSTAC items exceeds 500 (or the MaxItems setting, whichever
  217. is smaller), CLIPSTAC will drop the item at the end of the list. The
  218. CLIPSTAC About box reports the current number of items in the list; just
  219. select About ClipStac from CLIPSTAC's System Menu.
  220.  
  221.      Whether a CLIPSTAC item falls off the end of the list or you use
  222. the Delete button to remove it, the item is not immediately removed from
  223. the CLIPSTAC.DAT file. As with many of the popular PC database programs,
  224. you must occasionally pack CLIPSTAC's data file to remove deleted items
  225. from the file and recover the disk space they occupied. When you press
  226. the Pack button, CLIPSTAC will write out a new copy of CLIPSTAC.DAT that
  227. contains only those items that are current in the list. And, wherever an
  228. item was created via the Copy or ToTop buttons, only a single copy of
  229. that item will remain in the entire data file.
  230.  
  231.      Note that, as with PC database programs, packing can take some time,
  232. especially if CLIPSTAC's list gets large or contains large items. If you
  233. find yourself using Pack during every CLIPSTAC session, you can check
  234. the AutoPack option in CLIPSTAC's System Menu. This will cause CLIPSTAC
  235. to pack CLIPSTAC.DAT automatically each time you start the program.
  236.  
  237. Richard Hale Shaw is a contributing editor to PC Magazine.